<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社区交流 - 1024导航</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#F59E0B',
                        dark: '#1F2937',
                        light: '#F9FAFB'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .post-hover {
                @apply transition-all duration-300 hover:shadow-md hover:bg-gray-50;
            }
            .nav-active {
                @apply text-primary border-primary font-medium;
            }
            .badge {
                @apply text-xs px-2 py-0.5 rounded-full;
            }
            .text-gradient {
                @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary;
            }
        }
    </style>
</head>

<body class="bg-gray-50 font-sans text-gray-800">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <div class="text-primary text-2xl font-bold">1024<span class="text-secondary">导航</span></div>
                <span class="hidden md:inline-block text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded">v2.3</span>
            </div>

            <nav class="hidden md:flex items-center space-x-6">
                <a href="index.html" class="text-gray-600 hover:text-primary transition-colors">首页</a>
                <a href="resources.html" class="text-gray-600 hover:text-primary transition-colors">资源</a>
                <a href="tools.html" class="text-gray-600 hover:text-primary transition-colors">工具</a>
                <a href="#" class="text-primary font-medium">社区</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">关于</a>
            </nav>

            <div class="flex items-center space-x-3">
                <button
                    class="hidden md:block px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                    <i class="fa fa-user-plus mr-1"></i> 登录
                </button>
                <button class="md:hidden text-gray-600 text-xl">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 页面标题和搜索 -->
    <section class="py-10 bg-gradient-to-b from-white to-gray-50 border-b border-gray-100">
        <div class="container mx-auto px-4">
            <div class="max-w-3xl mx-auto text-center">
                <h1 class="text-[clamp(1.8rem,5vw,2.5rem)] font-bold mb-4 text-gradient">社区交流</h1>
                <p class="text-gray-600 mb-8">分享资源、交流经验、解决问题，共建优质社区</p>

                <div class="relative">
                    <input type="text" placeholder="搜索话题、帖子或用户..."
                        class="w-full px-5 py-4 rounded-lg shadow-md border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all">
                    <button
                        class="absolute right-2 top-2 bottom-2 px-5 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                        <i class="fa fa-search mr-1"></i> 搜索
                    </button>
                </div>
            </div>
        </div>
    </section>

    <!-- 社区内容区 -->
    <section class="py-10">
        <div class="container mx-auto px-4">
            <div class="max-w-5xl mx-auto flex flex-col lg:flex-row gap-6">
                <!-- 左侧边栏 -->
                <div class="lg:w-1/4">
                    <!-- 社区导航 -->
                    <div class="bg-white rounded-xl shadow-sm p-5 mb-6">
                        <h3 class="font-semibold text-lg mb-4 pb-2 border-b border-gray-100">社区导航</h3>

                        <ul class="space-y-1">
                            <li>
                                <a href="#"
                                    class="nav-active w-full text-left px-3 py-2.5 rounded-md transition-colors flex items-center">
                                    <i class="fa fa-fire mr-3 w-5 text-center"></i> 热门讨论
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="w-full text-left px-3 py-2.5 rounded-md transition-colors flex items-center hover:bg-gray-50 text-gray-600">
                                    <i class="fa fa-clock-o mr-3 w-5 text-center"></i> 最新发布
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="w-full text-left px-3 py-2.5 rounded-md transition-colors flex items-center hover:bg-gray-50 text-gray-600">
                                    <i class="fa fa-star-o mr-3 w-5 text-center"></i> 精华内容
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="w-full text-left px-3 py-2.5 rounded-md transition-colors flex items-center hover:bg-gray-50 text-gray-600">
                                    <i class="fa fa-question-circle mr-3 w-5 text-center"></i> 问答专区
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="w-full text-left px-3 py-2.5 rounded-md transition-colors flex items-center hover:bg-gray-50 text-gray-600">
                                    <i class="fa fa-share-alt mr-3 w-5 text-center"></i> 资源分享
                                </a>
                            </li>
                        </ul>

                        <button
                            class="mt-4 w-full py-2.5 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors flex items-center justify-center">
                            <i class="fa fa-pencil mr-2"></i> 发布新帖
                        </button>
                    </div>

                    <!-- 社区分类 -->
                    <div class="bg-white rounded-xl shadow-sm p-5 mb-6">
                        <h3 class="font-semibold text-lg mb-4 pb-2 border-b border-gray-100">话题分类</h3>

                        <ul class="space-y-2">
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-code text-purple-500 mr-2"></i>
                                        编程开发
                                    </span>
                                    <span class="text-gray-400 text-sm">248</span>
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-paint-brush text-pink-500 mr-2"></i>
                                        设计创意
                                    </span>
                                    <span class="text-gray-400 text-sm">156</span>
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-graduation-cap text-amber-500 mr-2"></i>
                                        学习交流
                                    </span>
                                    <span class="text-gray-400 text-sm">312</span>
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-tools text-blue-500 mr-2"></i>
                                        工具评测
                                    </span>
                                    <span class="text-gray-400 text-sm">98</span>
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-share-alt text-green-500 mr-2"></i>
                                        资源分享
                                    </span>
                                    <span class="text-gray-400 text-sm">187</span>
                                </a>
                            </li>
                            <li>
                                <a href="#"
                                    class="flex items-center justify-between text-gray-700 hover:text-primary transition-colors">
                                    <span class="flex items-center">
                                        <i class="fa fa-coffee text-gray-500 mr-2"></i>
                                        闲聊灌水
                                    </span>
                                    <span class="text-gray-400 text-sm">423</span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- 右侧主内容区 -->
                <div class="lg:w-3/4">
                    <!-- 置顶帖子 -->
                    <div class="bg-white rounded-xl shadow-sm p-5 mb-6 border-l-4 border-accent post-hover">
                        <div class="flex justify-between items-start">
                            <div class="flex">
                                <img src="https://picsum.photos/id/1005/200/200" alt="管理员头像"
                                    class="w-10 h-10 rounded-full mr-3">
                                <div>
                                    <div class="flex items-center mb-1">
                                        <h3 class="font-semibold mr-2">社区规范及发帖指南</h3>
                                        <span class="badge bg-accent/10 text-accent">置顶</span>
                                        <span class="badge bg-blue-100 text-blue-700 ml-1">公告</span>
                                    </div>
                                    <div class="flex items-center text-sm text-gray-500 mb-2">
                                        <span class="font-medium text-gray-700">管理员</span>
                                        <span class="mx-2">•</span>
                                        <span>2023-05-15</span>
                                    </div>
                                    <p class="text-gray-600 text-sm mb-3">欢迎加入1024导航社区！为了维护良好的社区环境，请所有成员遵守社区规范...
                                        详细介绍了社区发帖规则、内容审核标准和违规处理办法。</p>
                                    <div class="flex items-center text-sm text-gray-400">
                                        <span class="mr-4"><i class="fa fa-eye mr-1"></i> 3.2k</span>
                                        <span><i class="fa fa-comment-o mr-1"></i> 128</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 帖子列表 -->
                    <div class="space-y-4">
                        <!-- 帖子1 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 post-hover">
                            <div class="flex justify-between items-start">
                                <div class="flex-1">
                                    <div class="flex">
                                        <img src="https://picsum.photos/id/1012/200/200" alt="用户头像"
                                            class="w-10 h-10 rounded-full mr-3">
                                        <div>
                                            <div class="flex items-center mb-1">
                                                <h3 class="font-semibold mr-2">推荐几个高质量的免费编程学习资源</h3>
                                                <span class="badge bg-green-100 text-green-700">资源分享</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-500 mb-2">
                                                <span class="font-medium text-gray-700">编程爱好者</span>
                                                <span class="mx-2">•</span>
                                                <span>2小时前</span>
                                            </div>
                                            <p class="text-gray-600 text-sm mb-3">
                                                最近整理了一些非常不错的免费编程学习资源，包括Python、JavaScript和Java的教程和实战项目，特别适合初学者入门...</p>
                                            <div class="flex flex-wrap gap-2 mb-3">
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#编程学习</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#免费资源</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#Python</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-400">
                                                <span class="mr-4"><i class="fa fa-eye mr-1"></i> 542</span>
                                                <span class="mr-4"><i class="fa fa-comment-o mr-1"></i> 36</span>
                                                <span><i class="fa fa-thumbs-o-up mr-1"></i> 89</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <img src="https://picsum.photos/id/0/100/100" alt="帖子配图"
                                    class="w-16 h-16 rounded-lg object-cover ml-4 hidden sm:block">
                            </div>
                        </div>

                        <!-- 帖子2 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 post-hover">
                            <div class="flex justify-between items-start">
                                <div class="flex-1">
                                    <div class="flex">
                                        <img src="https://picsum.photos/id/1027/200/200" alt="用户头像"
                                            class="w-10 h-10 rounded-full mr-3">
                                        <div>
                                            <div class="flex items-center mb-1">
                                                <h3 class="font-semibold mr-2">大家常用的图片处理工具有哪些？</h3>
                                                <span class="badge bg-blue-100 text-blue-700">问答</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-500 mb-2">
                                                <span class="font-medium text-gray-700">设计小白</span>
                                                <span class="mx-2">•</span>
                                                <span>昨天 14:30</span>
                                            </div>
                                            <p class="text-gray-600 text-sm mb-3">
                                                刚入门设计，想问问大家平时都用哪些图片处理工具？有没有免费又好用的推荐？主要用于简单的图片编辑、裁剪和格式转换...</p>
                                            <div class="flex flex-wrap gap-2 mb-3">
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#图片处理</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#工具推荐</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#设计</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-400">
                                                <span class="mr-4"><i class="fa fa-eye mr-1"></i> 328</span>
                                                <span class="mr-4"><i class="fa fa-comment-o mr-1"></i> 52</span>
                                                <span><i class="fa fa-thumbs-o-up mr-1"></i> 45</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 帖子3 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 post-hover">
                            <div class="flex justify-between items-start">
                                <div class="flex-1">
                                    <div class="flex">
                                        <img src="https://picsum.photos/id/1025/200/200" alt="用户头像"
                                            class="w-10 h-10 rounded-full mr-3">
                                        <div>
                                            <div class="flex items-center mb-1">
                                                <h3 class="font-semibold mr-2">分享一个超好用的在线代码编辑器</h3>
                                                <span class="badge bg-purple-100 text-purple-700">工具评测</span>
                                                <span class="badge bg-yellow-100 text-yellow-700 ml-1">精华</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-500 mb-2">
                                                <span class="font-medium text-gray-700">前端开发狮</span>
                                                <span class="mx-2">•</span>
                                                <span>3天前</span>
                                            </div>
                                            <p class="text-gray-600 text-sm mb-3">
                                                给大家推荐一个我最近在用的在线代码编辑器，支持多种语言语法高亮，内置终端，还能实时预览效果，最重要的是支持项目保存和分享功能...</p>
                                            <div class="flex flex-wrap gap-2 mb-3">
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#代码编辑器</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#前端开发</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#工具推荐</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-400">
                                                <span class="mr-4"><i class="fa fa-eye mr-1"></i> 1256</span>
                                                <span class="mr-4"><i class="fa fa-comment-o mr-1"></i> 87</span>
                                                <span><i class="fa fa-thumbs-o-up mr-1"></i> 215</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <img src="https://picsum.photos/id/180/100/100" alt="帖子配图"
                                    class="w-16 h-16 rounded-lg object-cover ml-4 hidden sm:block">
                            </div>
                        </div>

                        <!-- 帖子4 -->
                        <div class="bg-white rounded-xl shadow-sm p-5 post-hover">
                            <div class="flex justify-between items-start">
                                <div class="flex-1">
                                    <div class="flex">
                                        <img src="https://picsum.photos/id/1074/200/200" alt="用户头像"
                                            class="w-10 h-10 rounded-full mr-3">
                                        <div>
                                            <div class="flex items-center mb-1">
                                                <h3 class="font-semibold mr-2">学习Python一个月，我制作了第一个爬虫项目</h3>
                                                <span class="badge bg-green-100 text-green-700">技术分享</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-500 mb-2">
                                                <span class="font-medium text-gray-700">Python新手</span>
                                                <span class="mx-2">•</span>
                                                <span>1周前</span>
                                            </div>
                                            <p class="text-gray-600 text-sm mb-3">
                                                从零基础开始学习Python，花了一个月时间，终于完成了我的第一个爬虫项目，能够爬取指定网站的文章并保存为PDF。分享一下我的学习心得和项目代码...
                                            </p>
                                            <div class="flex flex-wrap gap-2 mb-3">
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#Python</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#爬虫</span>
                                                <span
                                                    class="text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded">#学习分享</span>
                                            </div>
                                            <div class="flex items-center text-sm text-gray-400">
                                                <span class="mr-4"><i class="fa fa-eye mr-1"></i> 987</span>
                                                <span class="mr-4"><i class="fa fa-comment-o mr-1"></i> 63</span>
                                                <span><i class="fa fa-thumbs-o-up mr-1"></i> 156</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <img src="https://picsum.photos/id/48/100/100" alt="帖子配图"
                                    class="w-16 h-16 rounded-lg object-cover ml-4 hidden sm:block">
                            </div>
                        </div>
                    </div>

                    <!-- 分页 -->
                    <div class="mt-8 flex justify-center">
                        <nav class="inline-flex rounded-md shadow-sm" aria-label="分页">
                            <a href="#"
                                class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                                <i class="fa fa-chevron-left"></i>
                            </a>
                            <a href="#"
                                class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-primary text-sm font-medium text-white">
                                1
                            </a>
                            <a href="#"
                                class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50">
                                2
                            </a>
                            <a href="#"
                                class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50">
                                3
                            </a>
                            <span
                                class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700">
                                ...
                            </span>
                            <a href="#"
                                class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50">
                                12
                            </a>
                            <a href="#"
                                class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
                                <i class="fa fa-chevron-right"></i>
                            </a>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 底部区域 -->
    <footer class="bg-gray-800 text-gray-300 py-10 mt-10">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">1024导航</h3>
                    <p class="text-sm text-gray-400 mb-4">精选互联网优质资源，打造高效便捷的导航平台，助力你的工作与学习。</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-github text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-twitter text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-weixin text-xl"></i>
                        </a>
                    </div>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">快速链接</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="index.html" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                        <li><a href="resources.html" class="text-gray-400 hover:text-white transition-colors">资源分类</a>
                        </li>
                        <li><a href="tools.html" class="text-gray-400 hover:text-white transition-colors">实用工具</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">社区交流</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">热门推荐</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">帮助支持</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">资源提交</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">举报不良信息</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">关于我们</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">网站介绍</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用条款</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">社区规范</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">免责声明</a></li>
                    </ul>
                </div>
            </div>

            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-sm text-gray-500">
                <p>© 2023 1024导航. 本站资源仅供学习交流使用，如有侵权请联系删除。</p>
            </div>
        </div>
    </footer>

    <!-- 回到顶部按钮 -->
    <button id="backToTop"
        class="fixed bottom-6 right-6 w-12 h-12 rounded-full bg-primary text-white shadow-lg flex items-center justify-center opacity-0 invisible transition-all duration-300">
        <i class="fa fa-arrow-up"></i>
    </button>

    <!-- 浮动发布按钮（移动端） -->
    <button
        class="fixed bottom-6 left-6 w-12 h-12 rounded-full bg-primary text-white shadow-lg flex items-center justify-center md:hidden">
        <i class="fa fa-pencil"></i>
    </button>

    <script>
        // 回到顶部按钮功能
        const backToTopBtn = document.getElementById('backToTop');

        window.addEventListener('scroll', () => {
            if (window.scrollY > 300) {
                backToTopBtn.classList.remove('opacity-0', 'invisible');
                backToTopBtn.classList.add('opacity-100', 'visible');
            } else {
                backToTopBtn.classList.remove('opacity-100', 'visible');
                backToTopBtn.classList.add('opacity-0', 'invisible');
            }

            // 导航栏滚动效果
            const header = document.querySelector('header');
            if (window.scrollY > 50) {
                header.classList.add('py-2', 'shadow');
                header.classList.remove('py-3', 'shadow-sm');
            } else {
                header.classList.add('py-3', 'shadow-sm');
                header.classList.remove('py-2', 'shadow');
            }
        });

        backToTopBtn.addEventListener('click', () => {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });

        // 社区导航切换功能
        const navLinks = document.querySelectorAll('.bg-white.rounded-xl.shadow-sm.p-5:first-of-type ul a');
        navLinks.forEach(link => {
            link.addEventListener('click', (e) => {
                e.preventDefault();

                // 移除所有链接的活跃状态
                navLinks.forEach(navLink => {
                    navLink.classList.remove('nav-active');
                    navLink.classList.add('text-gray-600', 'hover:bg-gray-50');
                });

                // 为当前点击的链接添加活跃状态
                link.classList.add('nav-active');
                link.classList.remove('text-gray-600', 'hover:bg-gray-50');

                // 在实际应用中，这里会根据选择的导航项加载相应的内容
                const navName = link.textContent.trim();
                console.log(`切换到社区导航: ${navName}`);
            });
        });

        // 话题分类点击功能
        const categoryLinks = document.querySelectorAll('.bg-white.rounded-xl.shadow-sm.p-5:nth-of-type(2) ul a');
        categoryLinks.forEach(link => {
            link.addEventListener('click', (e) => {
                e.preventDefault();

                // 在实际应用中，这里会根据选择的分类加载相应的帖子
                const categoryName = link.querySelector('span').textContent.trim();
                console.log(`切换到话题分类: ${categoryName}`);
            });
        });

        // 搜索功能
        const searchInput = document.querySelector('input[placeholder="搜索话题、帖子或用户..."]');
        const searchButton = document.querySelector('button:has(.fa-search)');

        function handleSearch() {
            const query = searchInput.value.trim();
            if (query) {
                alert(`搜索内容: ${query}\n在实际应用中，这里会显示搜索结果`);
            } else {
                alert('请输入搜索内容');
            }
        }

        searchButton.addEventListener('click', handleSearch);
        searchInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter') {
                handleSearch();
            }
        });

        // 发布新帖按钮点击效果
        const createPostButton = document.querySelector('button:has(.fa-pencil)');
        createPostButton.addEventListener('click', () => {
            alert('在实际应用中，这里会打开发布新帖的表单页面');
        });

        // 帖子点击效果
        const postItems = document.querySelectorAll('.post-hover');
        postItems.forEach(post => {
            post.addEventListener('click', () => {
                const postTitle = post.querySelector('h3').textContent;
                alert(`打开帖子详情: ${postTitle}\n在实际应用中，这里会跳转到帖子详情页`);
            });
        });

        // 分页按钮点击效果
        const paginationLinks = document.querySelectorAll('nav a');
        paginationLinks.forEach(link => {
            link.addEventListener('click', (e) => {
                e.preventDefault();
                const pageText = link.textContent.trim();
                console.log(`切换到分页: ${pageText}`);
            });
        });
    </script>
</body>

</html>